package utn.frsf.cidisi.upcolbpip.interactionprotocols.diagram.edit.policies;

import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

import utn.frsf.cidisi.upcolbpip.interactionprotocols.InteractionprotocolsPackage;
import utn.frsf.cidisi.upcolbpip.interactionprotocols.diagram.edit.commands.InteractionPathCreateCommand;
import utn.frsf.cidisi.upcolbpip.interactionprotocols.diagram.providers.UpcolbpipElementTypes;

/**
 * @generated
 */
public class ControlFlowSegmentControlFlowSegmentCompartment2ItemSemanticEditPolicy
		extends UpcolbpipBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (UpcolbpipElementTypes.InteractionPath_3001 == req.getElementType()) {
			if (req.getContainmentFeature() == null) {
				req.setContainmentFeature(InteractionprotocolsPackage.eINSTANCE
						.getControlFlowSegment_InteractionPath());
			}
			return getGEFWrapper(new InteractionPathCreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
